package hotel.meituan.oversea.biz.service.impl;

import hotel.base.oversea.service.impl.BaseServiceImpl;
import hotel.meituan.oversea.api.entity.MtHotelGoodsPrice;
import hotel.meituan.oversea.biz.mapper.MtHotelGoodsPriceMapper;
import hotel.meituan.oversea.biz.service.MtHotelGoodsPriceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

@Slf4j
@Service
public class MtHotelGoodsPriceServiceImpl extends BaseServiceImpl implements MtHotelGoodsPriceService {
    @Autowired
    MtHotelGoodsPriceMapper mtHotelGoodsPriceMapper;

    @Override
    public MtHotelGoodsPrice queryGoodsByDate(String mtHotelId, Integer mtGoodsId, String mtDate) {
        Example example = new Example(MtHotelGoodsPrice.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("mtGoodsId",mtGoodsId);
        criteria.andEqualTo("mtHotelId",mtHotelId);
        criteria.andEqualTo("mtDate",mtDate);
        MtHotelGoodsPrice mtHotelGoodsPrice = mtHotelGoodsPriceMapper.selectOneByExample(example);
        return mtHotelGoodsPrice;
    }
}
